%

clear;

final = cell(1,5);



for i = 1:5


    load(['FX_J_Model',num2str(i),'.mat'], 'Lambda_hat_AJX', 'Vn_AJX','R2_t');

    chi2_value_AJ = 1 - chi2cdf(Lambda_hat_AJX(:,1:i)*inv(Vn_AJX(1:i,1:i))*Lambda_hat_AJX(:,1:i)', (i));
    if chi2_value_AJ < 0.001
                
        final(1,i) = {'<0.001'};
    
    else
    
        final(1,i) = {sprintf('%.3f', chi2_value_AJ)};
    
    end


end

T = cell2table(final);
writetable(T, 'FX_Tests_Results.csv')
  
